package com.swinginwind.flexutils.functions
{
	import mx.formatters.DateFormatter;
	
	/**
	 * @author jimmy
	 * @E-mail: swinginwind@gmail.com
	 * @version 1.0.0
	 * 创建时间：2013-4-27 下午5:59:59
	 * 
	 */
	public class UtilsTime
	{
		public function UtilsTime()
		{
		}
		
		
		public static function parseString(date:Date, format:String="YYYY-MM-DD JJ:NN:SS"):String
		{
			var myDateFormatter:DateFormatter=new DateFormatter();  
			//myDateFormatter.formatString="YYYY-MM-DD JJ:NN:SS";  
			myDateFormatter.formatString = format;
			return myDateFormatter.format(date);
		}
		
		public static function parseDate(dateStr:String, format:String=null):Date
		{
			return DateFormatter.parseDateString(dateStr);
		}
	}
}